package uy.edu.ucu.isIII2008.ejercicioGC.parsing;

import java_cup.runtime.*;
%%
%public
%class Scanner
%extends sym
%unicode
%line
%column
%cup
%cupdebug
%caseless
%ignorecase

%{
  StringBuffer string = new StringBuffer();
  private Symbol symbol(int type) {
    return new Symbol(type, yyline+1, yycolumn+1);
  }
  private Symbol symbol(int type, Object value) {
    return new Symbol(type, yyline+1, yycolumn+1, value);
  }
%}

Double =  [0-9]+(\.[0-9]+)?

%%

<YYINITIAL> {

  "+"                            { return symbol(MAS); }
  "-"                            { return symbol(MENOS); }
  "*"                            { return symbol(POR); }
  "/"			   				 { return symbol(DIV); }
  "("							 { return symbol(APAREN); }
  ")"							 { return symbol(CPAREN); }
  {Double}       				 {return symbol(NUM, new Double(yytext()));}
}

<<EOF>>                          { return symbol(EOF); }